<?php
require_once("_connect.php");
if(count($_GET)>0)
{
	$memberno = $_GET["Search"];
	if($memberno != "")
	{
		echo lookupMsl($conn, $memberno);	
	}	
}

function findMsl($conn, $dist, $mslno, $chkdgt)
{
	$memberno = str_replace("-", "", mergeMsl($dist, $mslno, $chkdgt));
	$sql = "SELECT REPREP_CODE, REPREP_NAME  
			FROM msl WHERE 
			msl.REPREP_CODE ='".$memberno."'";
			//echo $sql;
	$raw = mysql_query($sql, $conn);
	$row = mysql_fetch_array($raw, MYSQL_ASSOC);
	if (is_array($row))
	{
		return $row["REPREP_NAME"];
	}
	else
	{
		return "Notfound";
	}	
}

function lookupMsl($conn, $memberno)
{
	$sql = "SELECT REPREP_CODE, REPREP_NAME  
			FROM msl WHERE 
			msl.REPREP_CODE ='".$memberno."'";
			//echo $sql;
	$raw = mysql_query($sql, $conn);
	$row = mysql_fetch_array($raw, MYSQL_ASSOC);
	if (is_array($row))
	{
		return $row["REPREP_NAME"];
	}
	else
	{
		return "Notfound";
	}	
}
?>